.material-switch {
  display: block;
  width: 37px;
  height: 14px;
  position: relative;
  margin-right: 19px;

  & .track {
    border-radius: 19px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1px;
    right: 1px;
    background: rgba(#000, 0.26);
    overflow: hidden;
    @include transform(translateZ(0));

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: #9FA8DA;
      opacity: 0;
      @include transition(opacity 0.15s ease-out);
      @include transform(translateZ(0));

      // Safari needs this because it hates me & fails to clip properly
      border-radius: 19px;

      // But it causes issues in other browsers so:
      @supports (transform: none) {
        border-radius: 0;
      }
    }
  }

  & .handle {
    position: absolute;
    top: -3px;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 20px;
    background: #fafafa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5), 
                inset 0 0 0 2px transparent;
    overflow: hidden;
    box-sizing: border-box;
    @include transition(all 0.15s ease-out);
    @include transform(translateZ(0));

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: #3F51B5;
      opacity: 0;
      @include transition(opacity 0.15s ease-out);
      @include transform(translateZ(0));

      // Safari needs this because it hates me & fails to clip properly
      border-radius: 10px;

      // But it causes issues in other browsers so:
      @supports (transform: none) {
        border-radius: 0;
      }
    }
  }

  :checked + & {
    & .track::before {
      opacity: 1;
    }

    & .handle {
      @include transform(translate3d(17px, 0, 0));
      box-shadow: 0 1px 3px rgba(0,0,0,0.5), 
                inset 0 0 0 2px transparent;

      &::before {
        opacity: 1;
      }
    }
  }
}